//
//  WMEDonut.m
//  WMEMusic
//
//  Created by 恩叔 on 16/4/30.
//  Copyright © 2016年 enshu. All rights reserved.
//

#import "WMEDonut.h"

@implementation WMEDonut

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)drawRect:(CGRect)rect {
    [super drawRect:rect];
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextSetRGBStrokeColor(context, 255/255.0, 255/255.0, 255/255.0, 1);//边框颜色
    CGContextSetLineWidth(context, 2);//边框宽度
    /*
     CG_EXTERN void CGContextAddArc(CGContextRef __nullable c, CGFloat x, CGFloat y,
     CGFloat radius, CGFloat startAngle, CGFloat endAngle, int clockwise)
     CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);
     */
    //参数1:上下文
    //参数2:X
    //参数3:Y
    //参数4:半径
    //参数5:起始角度
    //参数6:结束角度
    //参数7:顺时针0 逆时针1
    [[UIColor whiteColor] setStroke];
    [[UIColor whiteColor] setFill];
    CGContextAddArc(context, 45, 45, 44, 0, 2*M_PI, 0);
    CGContextDrawPath(context, kCGPathStroke);

    
    

//    CGContextRef ctx = UIGraphicsGetCurrentContext();
//    CGContextFillPath(ctx);
//    CGContextAddEllipseInRect(ctx, CGRectMake(0, 0, self.frame.size.width, self.frame.size.height));
//    CGContextSetLineWidth(ctx, 5);//边框宽度
//    
//    [[UIColor redColor] setStroke];
//    CGContextStrokePath(ctx);
}



@end
